package com.lizhi.yun.db.stand.pojo;/**
 * @program: sfrobot-html
 * @name StandPtInfo
 * @description: 患者信息
 * @author: lizhi
 * @create: 2020-04-24 14:30
 */

import com.lizhi.mybatis.boot.Description;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

/**
 *@program: sfrobot-html
 *@name StandPtInfo
 *@description: 患者信息
 *@author: lizhi
 *@create: 2020-04-24 14:30
 */
@Data
@ToString
@Entity
@Table(name = "stand_pt_info")
@Description("患者信息")
public class StandPtInfoPOJO {

    @Id
    @Column(length = 30)
    @Description("lid")
    public String lid;

    @Column(length = 30)
    @Description("患者id")
    private String ptId;

    @Column(length = 200)
    @Description("患者编号")
    private String ptNo;

    @Column(length = 200)
    @Description("患者名称")
    private String ptNm;

    @Column(length = 200)
    @Description("患者年龄")
    private String ptAge;

    @Column(length = 2)
    @Description("患者性别（00-男，01-女）")
    private String ptSex;

    @Transient
    @Description("患者性别")
    private String ptSexText;

    @Column(length = 2)
    @Description("患者证件类型(00-身份证，01-护照)")
    private String ptCerTp;

    @Transient
    @Description("患者证件类型")
    private String ptCerTpText;

    @Column(length = 200)
    @Description("患者证件号")
    private String ptCerNo;

    @Column(length = 12)
    @Description("患者出生日期")
    private String ptBirth;

    @Column(length = 11)
    @Description("患者手机号")
    private String ptPhone;

    @Column(length = 4000)
    @Description("患者家庭住址")
    private String ptAddres;

    @Column(length = 200)
    @Description("患者主治医生")
    private String ptDoctor;

    @Column(length = 200)
    @Description("患者重量（单位kg）")
    private String ptWg;

    @Column(length = 200)
    @Description("患者减重值（单位kg）")
    private String ptRedWg;

    @Column(length = 200)
    @Description("被动运动速度（单位mm/s）")
    private String ptPassSp;

    @Column(length = 4000)
    @Description("备注信息")
    private String ptRmk;

    @Column(length = 500)
    @Description("创建者")
    private String ptCrtBy;

    @Column(length = 500)
    @Description("更新者")
    private String ptUpdBy;

    @Column(length = 19)
    @Description("入表时间（YYYY-mm-dd HH:mm:ss）")
    private String ptIstTm;

    @Column(length = 19)
    @Description("更新时间（YYYY-mm-dd HH:mm:ss）")
    private String ptUpdTm;

    @Column(length = 2)
    @Description("患者状态,正常--00，出院--01,已删除--02")
    private String ptState;

    @Transient
    @Description("患者状态")
    private String ptStateText;

    @Column(length = 200)
    @Description("患者身高 单位厘米")
    private String ptHeight;

    @Column(length = 2)
    @Description("上传云管的状态(00-未上传，01-已上传)")
    private String dataUpState;

    @Transient
    @Description("上传云管的状态")
    private String dataUpStateText;

    @Column(length = 19)
    @Description("患者信息上传到云管的时间")
    private String dataUpTime;


    /*云管需要的数据*/
    @Column(length = 200)
    @Description("医院ID")
    private String hospitalId;

    @Transient
    @Description("医院名称")
    private String hospitalName;

    @Column(length = 200)
    @Description("系统ID")
    private String hospitalSystemId;

    public String getPtSexText() {
        if ("00".equals(this.ptSex)){
            this.ptSexText = "男";
        } else if ("01".equals(this.ptSex)){
            this.ptSexText = "女";
        }
        return ptSexText;
    }

    public String getPtCerTpText() {
        if ("00".equals(this.ptCerTp)){
            this.ptCerTpText = "身份证";
        } else if ("01".equals(this.ptCerTp)){
            this.ptCerTpText = "护照";
        }
        return ptCerTpText;
    }

    public String getPtStateText() {
        if ("00".equals(this.ptState)){
            this.ptStateText = "正常";
        } else if ("01".equals(this.ptState)){
            this.ptStateText = "出院";
        } else if ("02".equals(this.ptState)){
            this.ptStateText = "已删除";
        }
        return ptStateText;
    }

    public String getDataUpStateText() {
        if ("00".equals(this.dataUpState)){
            this.dataUpStateText = "未上传";
        } else if ("01".equals(this.dataUpState)){
            this.dataUpStateText = "已上传";
        }
        return dataUpStateText;
    }
}
